<?php

class NewsAction extends Action {
   
	public function index(){

        $news = M('news');
        $data['news'] = $news->select();


        $this->assign($data);
        $this->display('news');
    }

    public function news_detail(){

        $nid = isset($_GET['id']) ? $_GET['id'] : 0;
        $new = M('news');
        $data['new'] = $new->where("nid = '$nid'")->find();
//        print_r($data['new']);
        $this->assign($data);
        $this->display();
    }

   
}